home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 58 / pcpp58a.iso / extras / quake 3 source / Q3A_ToolSource.exe / Main / GLInterface.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-02  |  2.0 KB  |  72 lines

  1. //-----------------------------------------------------------------------------
  2. //
  3. // $LogFile$
  4. // $Revision: 1.1.1.4.2.1 $
  5. // $Author: ttimo $
  6. // $Date: 2000/02/04 22:59:34 $
  7. // $log$
  8. // Revision 1.1.1.3  1999/12/29 18:31:26  TBesset
  9. // Q3Radiant public version
  10. //
  11. // Revision 1.2  1999/11/22 17:46:45  Timo & Christine
  12. // merged EARadiant into the main tree
  13. // bug fixes for Q3Plugin / EAPlugin
  14. // export for Robert
  15. //
  16. // Revision 1.1.4.1  1999/11/03 20:37:59  Timo & Christine
  17. // MEAN plugin for Q3Radiant, alpha version
  18. //
  19. // Revision 1.1.2.1  1999/10/27 08:34:26  Timo & Christine
  20. // preview version of the texture tools plugin is ready
  21. // ( TexTool.dll plugin is in Q3Plugin module )
  22. // plugins can draw in their own window using Radiant's qgl bindings
  23. //
  24. //
  25. // DESCRIPTION:
  26. // Quick interface hack for selected face interface
  27. // this one really needs more work, but I'm in a hurry with TexTool
  28.  
  29. #include "stdafx.h"
  30.  
  31. // stores objects that want to be hooked into drawing in the XY window
  32. //++timo TODO: add support for camera view, Z view ... (texture view?)
  33. CPtrArray l_GLWindows;
  34.  
  35. int WINAPI QERApp_ISelectedFace_GetTextureNumber()
  36. {
  37.     if (g_ptrSelectedFaces.GetSize() > 0)
  38.     {
  39.         face_t *selFace = reinterpret_cast<face_t*>(g_ptrSelectedFaces.GetAt(0));
  40.         return selFace->d_texture->texture_number;
  41.     }
  42.     //++timo hu ? find the appropriate gl bind number
  43.     return 0;
  44. }
  45.  
  46. void WINAPI QERApp_HookXYGLWindow(IGLWindow* pGLW)
  47. {
  48.     l_GLWindows.Add( pGLW );
  49.     pGLW->IncRef();
  50. }
  51.  
  52. void WINAPI QERApp_UnHookGLWindow(IGLWindow* pGLW)
  53. {
  54.     for( int i = 0; i < l_GLWindows.GetSize(); i++ )
  55.     {
  56.         if (l_GLWindows.GetAt(i) == pGLW)
  57.         {
  58.             l_GLWindows.RemoveAt(i);
  59.             pGLW->DecRef();
  60.             return;
  61.         }
  62.     }
  63. #ifdef _DEBUG
  64.     Sys_Printf("ERROR: IGLWindow* not found in QERApp_UnHookGLWindow\n");
  65. #endif
  66. }
  67.  
  68. void DrawPluginEntities( VIEWTYPE vt )
  69. {
  70.     for(int i = 0; i<l_GLWindows.GetSize(); i++ )
  71.         static_cast<IGLWindow*>(l_GLWindows.GetAt(i))->Draw( vt );
  72. }